use serde::{Serialize, Deserialize};


// https://tauri.app/zh/v1/guides/features/command

#[tauri::command]
pub fn hello_fn(msg: &str) -> String {
    println!("{}", msg);
    format!("返回的字符串数据: {}", msg)
}

// 返回的参数必须实现 Serialize 特征, 接受的参数必须实现 Serialize + Deserialize + Clone
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct TestParams {
    pub name: String,
    pub is_flog: bool,
}

#[tauri::command]
pub fn invoke_fn(invoke_parpms: TestParams) -> () {
    println!("rust invoke_fn {:#?}", invoke_parpms);
}